
#include <stdlib.h>
#include <stdio.h>

enum{N=100};
int a,b,c,d,e,f;
typedef long long i64;
i64 H[N+1],k,*p;
void fill(){
    int i;
    for(i=1;i<=N;i++)
        H[i]=1LL*i*i*i*i*i;
}
int cmp(const void *a, const void *b) {
    return *(i64*)(a)-*(i64*)(b);
}

int main() {
  i64 start = clock();
  fill();
  for (a = 1; a < N; a++)
    for (b = 1; b <=a; b++)
      for (c = 1; c <=b; c++)
        for (d = 1; d <=c; d++)
          for (e=1; e <=d; e++) {
            k = H[a] + H[b] + H[c] + H[d] + H[e];
            p = bsearch(&k, H + a+1, N - a -1, sizeof(H[0]), cmp);
            if (p)
                    printf("%d %d %d %d %d %d\n", a, b, c, d, e, p - H);
          }
  i64  end = clock();
  printf("%.2f\n", (end - start) / 1000.0);
  return 0;
}

